<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页HTML</title>
</head>
<body>
    <h1>wellcome</h1><a href="/rmqp/toTarget">toTarget</a>
    <p id="msg"></p>
    <input type="text" name="msgInput">
    <button id="send">发送消息</button>
    <button id="accept">接收消息</button>
</body>
<script src="https://www.jq22.com/jquery/jquery-2.1.1.js"></script>
<script>
    $("#send").click(function(){
        let textVal = $("input[name='msgInput']").val();
        console.log(textVal);
        $.ajax({
            url:"/rmqp/send/message",
            type:"post",
            data:textVal,
            success:function (response) {
                $("#msg").text(response);
            },
            error:function (response) {
                $("#msg").text(response);
            }
        });
    });
    $("#accept").click(function(){
        $.ajax({
            url:"/rmqp/accept/message",
            type:"post",
            success:function (response) {
                console.log(response);
            },
            error:function (response) {
                $("#msg").text(response);
            }
        });
    });

</script>
</html>